namespace KPIS.GERP.Models.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class update0117 : DbMigration
    {
        public override void Up()
        {
            RenameColumn("dbo.SysTaskHistory", "CurrentApproverType", "ApproverType");
            RenameColumn("dbo.SysTaskHistory", "CurrentApproverTypeText", "ApproverTypeText");
            RenameColumn("dbo.SysTaskHistory", "CurrentApproverPosId", "ApproverPosId");


            //DropForeignKey("dbo.SysTaskHistory", "CurrentApproverPosId", "dbo.hrm_mp_positions");
            //DropIndex("dbo.SysTaskHistory", new[] { "CurrentApproverPosId" });
            //AddColumn("dbo.SysTaskHistory", "ApproverType", c => c.Int(nullable: false));
            //AddColumn("dbo.SysTaskHistory", "ApproverTypeText", c => c.String());
            //AddColumn("dbo.SysTaskHistory", "ApproverPosId", c => c.Int());
            //AddForeignKey("dbo.SysTaskHistory", "ApproverPosId", "dbo.hrm_mp_positions", "pos_seq");
            //CreateIndex("dbo.SysTaskHistory", "ApproverPosId");
            //DropColumn("dbo.SysTaskHistory", "CurrentApproverType");
            //DropColumn("dbo.SysTaskHistory", "CurrentApproverTypeText");
            //DropColumn("dbo.SysTaskHistory", "CurrentApproverPosId");
        }
        
        public override void Down()
        {
            RenameColumn("dbo.SysTaskHistory", "ApproverType", "CurrentApproverType");
            RenameColumn("dbo.SysTaskHistory", "ApproverTypeText", "CurrentApproverTypeText");
            RenameColumn("dbo.SysTaskHistory", "ApproverPosId", "CurrentApproverPosId");
            //AddColumn("dbo.SysTaskHistory", "CurrentApproverPosId", c => c.Int());
            //AddColumn("dbo.SysTaskHistory", "CurrentApproverTypeText", c => c.String());
            //AddColumn("dbo.SysTaskHistory", "CurrentApproverType", c => c.Int(nullable: false));
            //DropIndex("dbo.SysTaskHistory", new[] { "ApproverPosId" });
            //DropForeignKey("dbo.SysTaskHistory", "ApproverPosId", "dbo.hrm_mp_positions");
            //DropColumn("dbo.SysTaskHistory", "ApproverPosId");
            //DropColumn("dbo.SysTaskHistory", "ApproverTypeText");
            //DropColumn("dbo.SysTaskHistory", "ApproverType");
            //CreateIndex("dbo.SysTaskHistory", "CurrentApproverPosId");
            //AddForeignKey("dbo.SysTaskHistory", "CurrentApproverPosId", "dbo.hrm_mp_positions", "pos_seq");
        }
    }
}
